<template>
	<div class="ard content-box">
		<span class="text">添加数据 🍓🍇🍈🍉</span>
		<div style="display: flex">
			<el-button type="primary" :icon="Upload" @click="importIn">添加数据</el-button>
			<el-button type="primary" :icon="Download" @click="exportOut">导出数据</el-button>
		</div>

		<ImportExcel ref="importRef" />
	</div>
</template>
<script lang="ts" setup name="fileProTable">
import { ref } from "vue";
import { Upload, Download } from "@element-plus/icons-vue";
import ImportExcel from "@/components/ImportExcel/index.vue";
import { importData, downloadModel, exportData } from "@/api/modules/test/proTable";
import { useDownload } from "@/hooks/useDownload";

const importRef = ref();
const importIn = () => {
	let params = {
		title: "数据",
		tempApi: downloadModel,
		importApi: importData
	};
	importRef.value.acceptParams(params);
};

const exportOut = () => {
	useDownload(exportData, "导出模板");
};
</script>